﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="DM_Kho.aspx.cs"
    Inherits="HoaDon.DM_Kho" Title="Danh mục kho" %>

<asp:Content ID="cthoadon" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager runat="server">
    </asp:ScriptManager>
    <br />
    <asp:Label ID="lbkhuvuc" runat="server" Font-Bold="True" Font-Size="14pt" ForeColor="#663300"
        Text="DANH MỤC KHO"></asp:Label>
    <br />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:GridView ID="gdvkhuvuc" runat="server" AutoGenerateColumns="false" AllowPaging="true"
                ShowFooter="true" OnPageIndexChanging="OnPaging" OnRowEditing="EditDM" OnRowUpdating="UpdateDM"
                OnRowCancelingEdit="CancelEditDM" PageSize="10">
                <AlternatingRowStyle BackColor="GradientActiveCaption" />
                <PagerStyle BackColor="WhiteSmoke" ForeColor="Black" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <HeaderStyle BackColor="DodgerBlue" Font-Bold="True" ForeColor="White" />
                <EditRowStyle BackColor="#009933" />
                <Columns>
                    <asp:TemplateField HeaderText="Mã kho">
                        <ItemTemplate>
                            <asp:Label ID="KhoID" runat="server" Text='<%# Eval("KhoID")%>'></asp:Label>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txtKhoID" runat="server"></asp:TextBox>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Tên kho">
                        <ItemTemplate>
                            <asp:Label ID="KhoName" runat="server" Text='<%# Eval("KhoName")%>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="tbKhoName" runat="server" Text='<%# Eval("KhoName")%>'></asp:TextBox>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txtKhoName" runat="server"></asp:TextBox>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:Button ID="btnEdit" runat="server" CommandArgument='<%# Eval("KhoID")%>' Text="Sửa"
                                CommandName="Edit"></asp:Button>
                            <asp:Button ID="btnDedele" runat="server" CommandArgument='<%# Eval("KhoID")%>' Text="Xóa"
                                OnClick="DeleteDM"></asp:Button>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:Button ID="btUpdate" runat="server" CommandArgument='<%# Eval("KhoID")%>' Text="Đồng ý"
                                CommandName="Update" />
                            <asp:Button ID="btHuy" runat="server" CommandArgument='<%# Eval("KhoID")%>' Text="Hủy"
                                CommandName="Cancel" />
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:Button ID="btnAdd" runat="server" Text="Thêm" OnClick="AddNewDM" />
                        </FooterTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:Label ID="lbError" runat="server" ForeColor="Red"></asp:Label>
            <br />
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="gdvkhuvuc" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
